package com.xc.common.snowid;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BossAutoConfiguration {
	@Value("${snowid.machine-id}")
	private Long machineId;
	@Value("${snowid.data-center-id}")
	private Long dataCenterId;

    @Bean
    @ConditionalOnMissingBean
    public SnowflakeManager snowflakeManager() {
        return new SnowflakeManager(machineId, dataCenterId);
    }
}
